package com.hinnotek.amoeba.ui.activity.old

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.lee.common.base.BaseActivity
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.adapters.old.PTCreateRelatedListAdapter
import com.hinnotek.amoeba.databinding.ActivityPtCreateUserProjectListBinding
import com.hinnotek.amoeba.utilities.IntentUtils
import java.util.*


class PTCreateRelatedListActivity : BaseActivity<ActivityPtCreateUserProjectListBinding>() {

    private var mAdapter: PTCreateRelatedListAdapter? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setLeftVisible(true)
        setTitle("建立关联")

        setContentView(R.layout.activity_pt_create_user_project_list)
    }

    override fun initVew() {
        bindingView.superButtonCreate.text = "建立关联"
        val manager = LinearLayoutManager(mContext)
        manager.orientation = RecyclerView.VERTICAL
        bindingView.recyclerView.layoutManager = manager
        bindingView.recyclerView.adapter = PTCreateRelatedListAdapter().also { mAdapter = it }
        mAdapter!!.setOnItemClickListener { _: BaseQuickAdapter<*, *>?, _: View?, _: Int ->
            IntentUtils.startActivity(mContext, PTCreateRelatedActivity::class.java)
        }
    }

    override fun setData() {
        val stringList: MutableList<String> = ArrayList()
        for (i in 0..5) {
            stringList.add(i.toString() + "厂")
        }
        mAdapter!!.setList(stringList)
    }
}